package com.test.design.example3.buildermethod;

import com.test.design.example3.builder.Director;
import com.test.design.example3.builder.HouseBuilder;
import com.test.design.example3.builder.impl.ConcreteHouseBuilder;
import com.test.design.example3.dto.House;

import java.util.Date;

/**
 * @program: design-patternz
 * @description: 使用建造者方法
 * @author: <a href="mailto:zhengjiaming@gtmap.cn">zhengjiaming</a>
 * @create: 2024-12-26 14:15
 **/
public class UseBuilderMethod {
    public static void main(String[] args) {
        HouseBuilder builder = new ConcreteHouseBuilder();
        Director director = new Director(builder);
        director.constructHouse();
        House house = builder.getHouse();
        System.out.println(new Date());
        System.out.println(house);  // 输出: House with Concrete Walls, Concrete Roof, and Concrete Floor
    }
}
